/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

#ifndef PLC4C_MQTT_READ_WRITE_MQT_T__REASON_CODE_H_
#define PLC4C_MQTT_READ_WRITE_MQT_T__REASON_CODE_H_

#include <stdbool.h>
#include <stdint.h>
#include <plc4c/driver_mqtt_static.h>
#include <plc4c/spi/read_buffer.h>
#include <plc4c/spi/write_buffer.h>

// Code generated by code-generation. DO NOT EDIT.


#ifdef __cplusplus
extern "C" {
#endif

enum plc4c_mqtt_read_write_mqt_t__reason_code {
  plc4c_mqtt_read_write_mqt_t__reason_code_SUCCESS = 0X00,
  plc4c_mqtt_read_write_mqt_t__reason_code_GRANTED_QOS_1 = 0X01,
  plc4c_mqtt_read_write_mqt_t__reason_code_GRANTED_QOS_2 = 0X02,
  plc4c_mqtt_read_write_mqt_t__reason_code_DISCONNECT_WITH_WILL_MESSAGE = 0X04,
  plc4c_mqtt_read_write_mqt_t__reason_code_NO_MATCHING_SUBSCRIBERS = 0x10,
  plc4c_mqtt_read_write_mqt_t__reason_code_NO_SUBSCRIPTION_EXISTED = 0x11,
  plc4c_mqtt_read_write_mqt_t__reason_code_CONTINUE_AUTHENTICATION = 0X18,
  plc4c_mqtt_read_write_mqt_t__reason_code_RE_AUTHENTICATE = 0X19,
  plc4c_mqtt_read_write_mqt_t__reason_code_UNSPECIFIED_ERROR = 0X80,
  plc4c_mqtt_read_write_mqt_t__reason_code_MALFORMED_PACKET = 0X81,
  plc4c_mqtt_read_write_mqt_t__reason_code_PROTOCOL_ERROR = 0X82,
  plc4c_mqtt_read_write_mqt_t__reason_code_IMPLEMENTATION_SPECIFIC_ERROR = 0X83,
  plc4c_mqtt_read_write_mqt_t__reason_code_UNSUPPORTED_PROTOCOL_VERSION = 0X84,
  plc4c_mqtt_read_write_mqt_t__reason_code_CLIENT_IDENTIFIER_NOT_VALID = 0X85,
  plc4c_mqtt_read_write_mqt_t__reason_code_BAD_USER_NAME_OR_PASSWORD = 0X86,
  plc4c_mqtt_read_write_mqt_t__reason_code_NOT_AUTHORIZED = 0X87,
  plc4c_mqtt_read_write_mqt_t__reason_code_SERVER_UNAVAILABLE = 0X88,
  plc4c_mqtt_read_write_mqt_t__reason_code_SERVER_BUSY = 0X89,
  plc4c_mqtt_read_write_mqt_t__reason_code_BANNED = 0X8A,
  plc4c_mqtt_read_write_mqt_t__reason_code_SERVER_SHUTTING_DOWN = 0X8B,
  plc4c_mqtt_read_write_mqt_t__reason_code_BAD_AUTHENTICATION_METHOD = 0X8C,
  plc4c_mqtt_read_write_mqt_t__reason_code_KEEP_ALIVE_TIMEOUT = 0X8D,
  plc4c_mqtt_read_write_mqt_t__reason_code_SESSION_TAKEN_OVER = 0X8E,
  plc4c_mqtt_read_write_mqt_t__reason_code_TOPIC_FILTER_INVALID = 0X8F,
  plc4c_mqtt_read_write_mqt_t__reason_code_TOPIC_NAME_INVALID = 0X90,
  plc4c_mqtt_read_write_mqt_t__reason_code_PACKET_IDENTIFIER_IN_USE = 0X91,
  plc4c_mqtt_read_write_mqt_t__reason_code_PACKET_IDENTIFIER_NOT_FOUND = 0X92,
  plc4c_mqtt_read_write_mqt_t__reason_code_RECEIVE_MAXIMUM_EXCEEDED = 0X93,
  plc4c_mqtt_read_write_mqt_t__reason_code_TOPIC_ALIAS_INVALID = 0X94,
  plc4c_mqtt_read_write_mqt_t__reason_code_PACKET_TOO_LARGE = 0X95,
  plc4c_mqtt_read_write_mqt_t__reason_code_MESSAGE_RATE_TO_HIGH = 0X96,
  plc4c_mqtt_read_write_mqt_t__reason_code_QUOTA_EXCEEDED = 0X97,
  plc4c_mqtt_read_write_mqt_t__reason_code_ADMINISTRATIVE_ACTION = 0X98,
  plc4c_mqtt_read_write_mqt_t__reason_code_PAYLOAD_FORMAT_INVALID = 0X99,
  plc4c_mqtt_read_write_mqt_t__reason_code_RETAIN_NOT_SUPPORTED = 0X9A,
  plc4c_mqtt_read_write_mqt_t__reason_code_QOS_NOT_SUPPORTED = 0X9B,
  plc4c_mqtt_read_write_mqt_t__reason_code_USE_ANOTHER_SERVER = 0X9C,
  plc4c_mqtt_read_write_mqt_t__reason_code_SERVER_MOVED = 0X9D,
  plc4c_mqtt_read_write_mqt_t__reason_code_SHARED_SUBSCRIPTIONS_NOT_SUPPORTED = 0X9E,
  plc4c_mqtt_read_write_mqt_t__reason_code_CONNECTION_RATE_EXCEEDED = 0X9F,
  plc4c_mqtt_read_write_mqt_t__reason_code_MAXIMUM_CONNECT_TIME = 0XA0,
  plc4c_mqtt_read_write_mqt_t__reason_code_SUBSCRIPTION_IDENTIFIERS_NOT_SUPPORTED = 0XA1,
  plc4c_mqtt_read_write_mqt_t__reason_code_WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED = 0XA2
};
typedef enum plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code;

// Get an empty NULL-struct
plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_null();

plc4c_return_code plc4c_mqtt_read_write_mqt_t__reason_code_parse(plc4c_spi_read_buffer* readBuffer, plc4c_mqtt_read_write_mqt_t__reason_code** message);

plc4c_return_code plc4c_mqtt_read_write_mqt_t__reason_code_serialize(plc4c_spi_write_buffer* writeBuffer, plc4c_mqtt_read_write_mqt_t__reason_code* message);

plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_value_of(char* value_string);

int plc4c_mqtt_read_write_mqt_t__reason_code_num_values();

plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_value_for_index(int index);

bool plc4c_mqtt_read_write_mqt_t__reason_code_get_disconnect_reason(plc4c_mqtt_read_write_mqt_t__reason_code value);
plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_get_first_enum_for_field_disconnect_reason(bool value);

bool plc4c_mqtt_read_write_mqt_t__reason_code_get_unsuback_response(plc4c_mqtt_read_write_mqt_t__reason_code value);
plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_get_first_enum_for_field_unsuback_response(bool value);

bool plc4c_mqtt_read_write_mqt_t__reason_code_get_suback_response(plc4c_mqtt_read_write_mqt_t__reason_code value);
plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_get_first_enum_for_field_suback_response(bool value);

bool plc4c_mqtt_read_write_mqt_t__reason_code_get_auth_reason(plc4c_mqtt_read_write_mqt_t__reason_code value);
plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_get_first_enum_for_field_auth_reason(bool value);

bool plc4c_mqtt_read_write_mqt_t__reason_code_get_pubrel_pubcomp_response(plc4c_mqtt_read_write_mqt_t__reason_code value);
plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_get_first_enum_for_field_pubrel_pubcomp_response(bool value);

bool plc4c_mqtt_read_write_mqt_t__reason_code_get_puback_pubrec_response(plc4c_mqtt_read_write_mqt_t__reason_code value);
plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_get_first_enum_for_field_puback_pubrec_response(bool value);

bool plc4c_mqtt_read_write_mqt_t__reason_code_get_connack_response(plc4c_mqtt_read_write_mqt_t__reason_code value);
plc4c_mqtt_read_write_mqt_t__reason_code plc4c_mqtt_read_write_mqt_t__reason_code_get_first_enum_for_field_connack_response(bool value);

uint16_t plc4c_mqtt_read_write_mqt_t__reason_code_length_in_bytes(plc4c_mqtt_read_write_mqt_t__reason_code* message);

uint16_t plc4c_mqtt_read_write_mqt_t__reason_code_length_in_bits(plc4c_mqtt_read_write_mqt_t__reason_code* message);

#ifdef __cplusplus
}
#endif

#endif  // PLC4C_MQTT_READ_WRITE_MQT_T__REASON_CODE_H_
